Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STATS] Marking approximate points + general improvements #836

Merged
merged 63 commits into from
Apr 23, 2024

Conversation

bragov4ik
Copy link
Contributor

@bragov4ik bragov4ik commented Apr 17, 2024

Changes

Approximate points marking:

  • New field for data point (Point in proto) indicating whether the data is approximate (whether it should be drawn as such). Currently all those marks are placed on trailing subsequent points.
  • The field is omitted for false values in json serialization for efficiency. Absence of the field should be treated as false (meaning the data is not approximate == exact)

Noticeable changes in stats service:

  • Regardless of requested interval, no future points are now returned.
    • Previously they were generated according to settings; e.g. if one were to request data for 10 days forward.
  • Improved handling of near-today dates.
    • Previously was mitigated by manual removal of last point. It prevented new updated values from being shown until the end of the day. Now they will be returned as soon as they become available.
  • Added limit for maximum requested interval; it was possible to request server to generate data points for all days for ~ 10 000 years, which might be vulnerable to DoS (easy to fix so added just in case). The limit is configurable, default value - 500 years (max request processing time change from ~200ms to ~50ms).

Other:

  • Development docker compose for stats service
  • Restructure in stats service source code to accomodate the changes
  • Readability improvements
  • Updated timestamp columns in stats db to consider timezone. Did not cause troubles yet; a preventive measure.
  • Pass time as argument instead of calling ..::now() during update (for better testability)

@bragov4ik bragov4ik force-pushed the kirillivanov/stats-approx-points branch from 52a0760 to 290811c Compare April 17, 2024 14:58
@bragov4ik bragov4ik requested review from sevenzing and rimrakhimov and removed request for rimrakhimov April 18, 2024 10:40
stats/justfile Outdated Show resolved Hide resolved
@bragov4ik bragov4ik force-pushed the kirillivanov/stats-approx-points branch from 22ddaeb to 1d93f08 Compare April 18, 2024 12:53
@bragov4ik bragov4ik requested a review from sevenzing April 18, 2024 13:48
@rimrakhimov rimrakhimov self-requested a review April 19, 2024 14:05
@bragov4ik bragov4ik merged commit 39aac7f into main Apr 23, 2024
3 checks passed
@rimrakhimov rimrakhimov deleted the kirillivanov/stats-approx-points branch June 14, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants